import request from '@/utils/request'

// 查询订单信息列表
export function listOrder(query) {
  console.log(query)
  return request({
    url: '/order/order/list',
    method: 'get',
    params: query
  })
}

// 查询订单信息详细
export function getOrder(id) {
  return request({
    url: '/order/order/' + id,
    method: 'get'
  })
}

// 新增订单信息
export function addOrder(data) {
  return request({
    url: '/order/order',
    method: 'post',
    data: data
  })
}

// 修改订单信息
export function updateOrder(data) {
  return request({
    url: '/order/order',
    method: 'put',
    data: data
  })
}

// 删除订单信息
export function delOrder(id) {
  return request({
    url: '/order/order/' + id,
    method: 'delete'
  })
}
// 删除订单信息
export function logicDelOrder(id) {
  return request({
    url: '/order/order/' + id,
    method: 'delete'
  })
}

// 导出订单信息
export function exportOrder(query) {
  return request({
    url: '/order/order/export',
    method: 'get',
    params: query
  })
}

export function refuseRefund(data,id) {
  return request({
    url: '/order/order/refuseRefund/' + id+'?reason='+data.reason,
    method: 'post',
    // data: data
  })
}

export function passRefund(data) {
  return request({
    url: '/order/order/passRefund?orderId='+data.orderId+'&refundPrice='+data.refundPrice,
    method: 'post',
    data: data
  })
}

